The invention relates to integrated circuit microcontrollers having analog input devices and, more particularly, to input voltage offset calibration of these analog input devices.
Integrated circuits are becoming far more sophisticated while continuing to drop in price. Combinations of both analog and digital functions fabricated on an integrated circuit die, or packaged in a multi-chip package (MCP), are becoming more prevalent and are further increasing the usefulness and reducing the cost of consumer and industrial products. The combination of a microcontroller, and analog and digital circuit functions on an integrated circuit die or in an MCP has also expanded the useful range of applications. Consumer and commercial products, such as, for example, but not limited to, appliances, telecommunications devices, automobiles, security systems, full-house instant hot water heaters, thermostats and the like, are being controlled by integrated circuit microcontrollers. Analog inputs for receiving sensor information and analog outputs for controlling functions are necessary for the application of these microcontrollers. Heretofore separate and discrete analog-to-digital and digital-to-analog interfaces were used to connect the digital microcontroller to the outside analog world.
Analog input devices such as an analog-to-digital converter (ADC) in conjunction with a separate operational amplifier (op-amp) were used to convert a time-varying analog signal into digital representations thereof for application to digital inputs and use thereof by the microcontroller. Voltage and current levels were also detected by discrete integrated circuit voltage comparators that changed a digital output state when a certain analog value was present on the input of the comparator.
The op-amp (and comparator) is generally a differential input (inverting and noninverting inputs) analog device, and the circuit of the op-amp has inherent direct current (DC) input offset voltage that causes the output of the op-amp to be nonzero with a zero input voltage between the differential inputs. Many applications require an op-amp with a very small input offset voltage. To achieve small input offset voltage, normally a calibration step in the production of the op-amp is required. The calibration is typically performed at one operating point (e.g., temperature, common mode voltage, etc.) such that changes in operating environment are not compensated for. This calibration step takes time during manufacturing/testing and is therefore generally expensive to perform. Calibration of the op-amp at the time of manufacture brings the op-amp within the desired specifications, but cannot compensate for parameter changes affecting the op-amp calibration during operation, such as variations in voltage, temperature, etc.
Heretofore, eliminating or minimizing input offset voltage drift during operation of the op-amp was generally performed with a chopper-stabilized amplifier. The chopper-stabilized amplifier continuously sampled the op-amp""s input offset voltage, and subtracted this sampled input offset voltage from the desired signal voltage at the input of the op-amp. During the sampling period, the op-amp was not available for receiving the desired signal voltage. Thus, the effect of sampling in a chopper-stabilized amplifier is to limit the signal bandwidth of the op-amp. Chopper-stabilized amplifiers generally have a very low bandwidth because signal frequencies must be limited to less than half of the sampling frequency, otherwise aliasing errors will occur. Another drawback to the chopper-stabilized amplifier is that the continuous sampling causes the op-amp to be noisier than a non-chopper-stabilized amplifier.
The chopper-stabilized amplifier and other ways of calibrating the op-amp for minimum input offset voltage during operation in an application, generally, require external components such as switches, digital-to-analog converters, capacitors, etc. This requires additional components and printed circuit board space, along with increased assembly and testing time that is more expensive, and, generally, produces a less reliable product.
Technology has now advance to the point where analog input devices can be fabricated on the same integrated circuit die on which the digital microcontroller and its support logic and memories are also fabricated. This creates an additional problem in that the equipment used to test the digital microcontroller functions are not capable of performing on-line calibration of analog functions efficiently.
What is needed is a microcontroller based integrated circuit having both analog and digital functions, where the analog functions may be easily calibrated during initial manufacturing/testing and, additionally, may be calibrated in a system application so as to remain in or meet the desired specifications and operating parameters over all operating temperature, voltage, current, speed, power, pressure, humidity, etc., that may be encountered during normal operation, and that can be mass-produced to reduce overall product costs.
The invention overcomes the above-identified problems as well as other shortcomings and deficiencies of existing technologies by providing in a single integrated circuit package a system, method and apparatus for minimizing input offset voltage of an analog input device over all operating parameters. The system, method and apparatus of the present invention, may also be utilized to minimize the input offset voltage of a plurality of analog input devices on an integrated circuit die or in an MCP. A calibration circuit, used for minimizing the input offset voltage, and analog input device(s) may be fabricated in combination with a microcontroller system on an integrated circuit die or in an MCP. The calibration circuit of the present invention may quickly and easily compensate for input offset voltage of the analog input device. This compensation may be performed during initial manufacturing/testing and, in addition, may be performed at various times during the operation of the analog input device so as to more effectively maintain desired parameters and specifications over all of the operating conditions of temperature, voltage, current, speed, power, pressure, humidity, etc.
In an embodiment of the input voltage offset calibration circuit of the present invention, the analog input device has input offset voltage compensation or a trimming circuit that counteracts or compensates for the device input offset voltage by applying, for example, but not limited to, an opposite polarity voltage between the differential inputs of the analog input device so as to minimize the resulting voltage error at the output of the analog device. Switching of resistances, current sources and/or voltage sources in the differential input circuit of the analog input device may be used to compensate for the input offset voltage error. Other ways of compensating for the input offset voltage error now known or used in the future may be utilized in the present invention so long as they can be controlled by applying a digital value thereto.
A microcontroller applies a digital word to the input offset voltage compensation circuit when determining a digital value representative of the required input offset voltage compensation. A linear search or binary search of various digital values of the digital word may be used by the microcontroller calibration software program (firmware). During input offset voltage calibration, the inverting and non-inverting inputs and output of the analog input device are connected to feedback gain determining resistors, a reference voltage and a voltage comparator.
The voltage comparator compares the output of the analog input device and a voltage reference. When the output of the analog input device is equal to or greater than the voltage reference, the comparator output switches from a first logic level to a second logic level. The output of the comparator is connected to the microcontroller and signals the microcontroller by, for example, but not limited to, either an interrupt request input or by changing its output logic level as a status bit sampled by the microcontroller. The input offset voltage compensation circuit of the analog input device may have a storage register or memory that retains the digital value required for compensating the input offset voltage.
The voltage reference may be programmable for selecting a desired voltage value to be applied to the analog input device and comparator inputs during the calibration cycle. This feature of the invention allows the ability to vary the voltage reference so as to facilitate calibration at the common mode voltage which is very close to that of the application of use. The appropriate voltage reference value may be written to a control register associated with the voltage reference circuit before initiating the auto calibration of the analog input device. Different voltage reference values may be used for different analog input devices during input offset voltage compensation calibration thereof.
In another embodiment of the invention, a plurality of analog input devices may have their input offset voltages compensated for by multiplexing the comparator input between each of the plurality of analog input devices during calibration thereof The analog input devices have a common bus interface to the microcontroller. Thereby circuits and die area are reduced, saving costs and improving reliability.
When the input offset voltage calibration firmware in the microcontroller determines that the op-amp needs to be calibrated (to zero the input offset voltage), a calibration enable bit of a register in the microcontroller may be set by the firmware. Once this bit is set, the calibration function takes control of the op-amp operation, and a changing digital calibration word is applied to the op-amp while the microcontroller, in conjunction with the comparator, searches for the proper calibration value of the digital calibration word that will minimize the input offset voltage of the op-amp. Once this calibration operation has successfully completed, the op-amp will operate with minimum input offset voltage. The calibration enable bit is reset to indicate completion of the calibration process for that op-amp. Each analog input device (op-amp, comparator, multiplier, logarithmic amplifier, etc.) may have a unique calibration enable bit in the microcontroller register. Once the calibration enable bit is reset, that op-amp is now available to operate continuously, not being uninterrupted in time (not chopped), at full bandwidth.
A feature of the invention is calibration of input offset voltage for an analog input device, using a microcontroller, at any time during operation of the device.
Another feature is calibration of input offset voltages for a plurality of analog input devices using a microcontroller.
An advantage of the present invention is not having to calibrate an analog input device during manufacturing/testing of the device.
Another advantage is being able to dynamically calibrate the analog input device on demand and during operation thereof over all operating conditions.
Still another advantage is using only one calibration circuit to calibrate a plurality of analog input devices on an integrated circuit die or in an MCP.
Another advantage is using the same auto-calibration circuit for calibrating both op-amp and comparator analog input devices.
Other and further features and advantages will be apparent from the following description of presently preferred embodiments of the invention, given for the purpose of disclosure and taken in conjunction with the accompanying drawings.